1. Field of the Invention
Embodiments of the present invention generally relate to indexed color spaces and, more particularly, to a method and apparatus for reconstructing indexed color spaces.
2. Description of the Related Art
Many image container formats, such as Tagged Image File Format (TIFF), Portable Document Format (PDF), PHOTOSHOP® Document (PSD), ADOBE® ILLUSTRATOR® (AI), and the like, hold multiple images, each with its own indexed color space. The use of multiple indexed color spaces typically results in the image container including redundant color information. For example, an image container may hold an ADOBE® PHOTOSHOP® image. Each layer of a PHOTOSHOP® image is stored as an image stream. Similarly, each image included in a PDF is an image stream. When an image stream is encoded, color information may not be directly carried by the image pixel data, but is stored in a separate piece of data called a palette or an indexed color space. The palette is an array of unique color elements, in which every color element is identified by its position within the array. Accordingly, it is not necessary that each pixel of an image stream contain an independent and full specification of its color, and instead each image pixel need only refer to a position within the palette where its unique color is located. Hence, the palette is used as an index to look up the full specification of the color for that pixel. Since each image stream includes its own indexed color space, when an image container includes multiple image streams, redundant color specification information is often maintained. Redundancy of color information in image containers unnecessarily and undesirably increases the size of the overall image data stored in the given image container.
Currently, attempts to reduce redundancy include quantizing all of the colors to fit a palette by using, for example, color diffusion, and then indexing the resulting reduced color space. However, color quantization techniques result in the loss of important color information, and often deteriorate the original image after transformation.
Therefore, there is a need for a method and apparatus for reconstructing indexed color spaces.